using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace SanFS.MediaChangerLibrary
{
    /// <summary>
    /// A Virtual mediachanger driver for testing and development
    /// </summary>
    public class VirtualDriver : IMediaChangerDriver
    {
        private string          mPath;
        private IMediaChanger   mMediaChanger;
        private int             mNumDeviceSlots;
        
        public VirtualDriver(string Path)
        {
            mPath = Path;
            mNumDeviceSlots = -1;
        }
        
        #region IMediaChangerDriver Members

        public void Reset()
        {
            mNumDeviceSlots = -1;
           
        }

        public void Load(int ElementNumber)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public int Unload()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public List<IStorageElement> ReadInventory()
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public IMediaChanger MediaChanger
        {
            get
            {
                return mMediaChanger;
            }
            set
            {
                mMediaChanger = value;
            }
        }

        public int NumDeviceSlots
        {
            get
            {
                if (mNumDeviceSlots == -1)
                    throw new MediaChangerException("NumDeviceSlots cannot be read until device has been reset");
                return mNumDeviceSlots;
            }
        }
        
        #endregion
        
    }  // END CLASS
}  // END NAMESPACE
